Optimal. Leaf size=95 \[ -\frac{\cos ^3(c+d x)}{3 a d}-\frac{\cos (c+d x)}{a d}-\frac{3 \cot (c+d x)}{2 a d}+\frac{\cos ^2(c+d x) \cot (c+d x)}{2 a d}+\frac{\tanh ^{-1}(\cos (c+d x))}{a d}-\frac{3 x}{2 a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.156155, antiderivative size = 95, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 8, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.276, Rules used = {2839, 2591, 288, 321, 203, 2592, 302, 206} \[ -\frac{\cos ^3(c+d x)}{3 a d}-\frac{\cos (c+d x)}{a d}-\frac{3 \cot (c+d x)}{2 a d}+\frac{\cos ^2(c+d x) \cot (c+d x)}{2 a d}+\frac{\tanh ^{-1}(\cos (c+d x))}{a d}-\frac{3 x}{2 a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2839
Rule 2591
Rule 288
Rule 321
Rule 203
Rule 2592
Rule 302
Rule 206
Rubi steps
\begin{align*} \int \frac{\cos ^4(c+d x) \cot ^2(c+d x)}{a+a \sin (c+d x)} \, dx &=-\frac{\int \cos ^3(c+d x) \cot (c+d x) \, dx}{a}+\frac{\int \cos ^2(c+d x) \cot ^2(c+d x) \, dx}{a}\\ &=\frac{\operatorname{Subst}\left (\int \frac{x^4}{1-x^2} \, dx,x,\cos (c+d x)\right )}{a d}-\frac{\operatorname{Subst}\left (\int \frac{x^4}{\left (1+x^2\right )^2} \, dx,x,\cot (c+d x)\right )}{a d}\\ &=\frac{\cos ^2(c+d x) \cot (c+d x)}{2 a d}+\frac{\operatorname{Subst}\left (\int \left (-1-x^2+\frac{1}{1-x^2}\right ) \, dx,x,\cos (c+d x)\right )}{a d}-\frac{3 \operatorname{Subst}\left (\int \frac{x^2}{1+x^2} \, dx,x,\cot (c+d x)\right )}{2 a d}\\ &=-\frac{\cos (c+d x)}{a d}-\frac{\cos ^3(c+d x)}{3 a d}-\frac{3 \cot (c+d x)}{2 a d}+\frac{\cos ^2(c+d x) \cot (c+d x)}{2 a d}+\frac{\operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\cos (c+d x)\right )}{a d}+\frac{3 \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\cot (c+d x)\right )}{2 a d}\\ &=-\frac{3 x}{2 a}+\frac{\tanh ^{-1}(\cos (c+d x))}{a d}-\frac{\cos (c+d x)}{a d}-\frac{\cos ^3(c+d x)}{3 a d}-\frac{3 \cot (c+d x)}{2 a d}+\frac{\cos ^2(c+d x) \cot (c+d x)}{2 a d}\\ \end{align*}
Mathematica [A] time = 0.780923, size = 122, normalized size = 1.28 \[ -\frac{\tan \left (\frac{1}{2} (c+d x)\right ) \left (\cot \left (\frac{1}{2} (c+d x)\right )+1\right )^2 \left (27 \cos (c+d x)+(2 \sin (c+d x)-3) \cos (3 (c+d x))+6 \sin (c+d x) \left (5 \cos (c+d x)+4 \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )-4 \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )+6 c+6 d x\right )\right )}{48 a d (\sin (c+d x)+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.119, size = 230, normalized size = 2.4 \begin{align*}{\frac{1}{2\,da}\tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) }+{\frac{1}{da} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{5} \left ( 1+ \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{2} \right ) ^{-3}}-4\,{\frac{ \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{4}}{da \left ( 1+ \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{2} \right ) ^{3}}}-4\,{\frac{ \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{2}}{da \left ( 1+ \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{2} \right ) ^{3}}}-{\frac{1}{da}\tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \left ( 1+ \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{2} \right ) ^{-3}}-{\frac{8}{3\,da} \left ( 1+ \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{2} \right ) ^{-3}}-3\,{\frac{\arctan \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) }{da}}-{\frac{1}{2\,da} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{-1}}-{\frac{1}{da}\ln \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.54743, size = 374, normalized size = 3.94 \begin{align*} -\frac{\frac{\frac{16 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac{15 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac{24 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac{9 \, \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac{24 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac{3 \, \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} + 3}{\frac{a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \frac{3 \, a \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac{3 \, a \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac{a \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}}} + \frac{18 \, \arctan \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac{6 \, \log \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac{3 \, \sin \left (d x + c\right )}{a{\left (\cos \left (d x + c\right ) + 1\right )}}}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.1328, size = 284, normalized size = 2.99 \begin{align*} \frac{3 \, \cos \left (d x + c\right )^{3} -{\left (2 \, \cos \left (d x + c\right )^{3} + 9 \, d x + 6 \, \cos \left (d x + c\right )\right )} \sin \left (d x + c\right ) + 3 \, \log \left (\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) - 3 \, \log \left (-\frac{1}{2} \, \cos \left (d x + c\right ) + \frac{1}{2}\right ) \sin \left (d x + c\right ) - 9 \, \cos \left (d x + c\right )}{6 \, a d \sin \left (d x + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.34769, size = 198, normalized size = 2.08 \begin{align*} -\frac{\frac{9 \,{\left (d x + c\right )}}{a} + \frac{6 \, \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) \right |}\right )}{a} - \frac{3 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}{a} - \frac{3 \,{\left (2 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1\right )}}{a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )} - \frac{2 \,{\left (3 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} - 12 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{4} - 12 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 3 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 8\right )}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1\right )}^{3} a}}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]